package event


type EventHandle func(datas []interface{})

var events = make(map[string]EventHandle)


// 绑定Event
func RegisterEvent(key string, e EventHandle) {
	events[key] = e
}

// 发射Event
func Emit(key string, datas... interface{}) {
	e := events[key]
	if e != nil {
		e(datas)
	}
}

